//
//  TextField_TextView.m
//  HYTAPP
//
//  Created by 林建 on 17/7/21.
//  Copyright © 2017年 林建. All rights reserved.
//

#import "TextField_TextView.h"

@implementation TextField_TextView

-(instancetype)initWithFrame:(CGRect)frame contextHidden:(BOOL)contextHidden{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        //内容
        self.ContextLabel = [[UILabel alloc]init];
        [self addSubview:self.ContextLabel];
        self.ContextLabel.font = Common_Font(29);
        self.ContextLabel.textColor = Color.theme;
        //输入框
        self.OutPutTF = [[UITextField alloc]init];
        [self  addSubview:self.OutPutTF];
        self.OutPutTF.textColor = Color.theme;
        self.OutPutTF.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
        if (contextHidden == YES) {
            [self.OutPutTF mas_makeConstraints:^(MASConstraintMaker *make) {
                make.top.mas_equalTo(self.mas_top).offset(1);
                make.left.mas_equalTo(self.ContextLabel.mas_right).offset(30);
                make.right.mas_equalTo(self.mas_right).offset(30);
                make.height.mas_equalTo(59);
            }];
        } else {
            [self.ContextLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                make.top.mas_equalTo(self.mas_top);
                make.left.mas_equalTo(self.mas_left).offset(30);
                make.width.mas_equalTo(75);
                make.height.mas_equalTo(60);
            }];
            [self.OutPutTF mas_makeConstraints:^(MASConstraintMaker *make) {
                make.top.mas_equalTo(self.mas_top).offset(1);
                make.left.mas_equalTo(self.ContextLabel.mas_right);
                make.right.mas_equalTo(self.mas_right).offset(30);
                make.height.mas_equalTo(59);
            }];
        }
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
